<template>
  <div class="seasDetails">
    <div class="innerbox">
      <div class="seasinfo"><span>基本资料</span></div>
      <el-form
        :model="ruleForm"
        :rules="rules"
        ref="ruleForm"
        label-width="100px"
        class="demo-ruleForm"
      >
        <el-row>
          <el-col :span="24">
            <span>客户名称:</span>
            <span class="spanborder">{{ ruleForm.customer_name }}</span>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <span>联系人:</span>
            <span class="spanborder">{{ ruleForm.contact_name }}</span>
          </el-col>
          <el-col :span="12">
            <span>手机号码:</span>
            <span class="spanborder">{{ ruleForm.phone }}</span>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <span>QQ:</span>
            <span class="spanborder">{{ ruleForm.qq }}</span>
          </el-col>
          <el-col :span="12">
            <span>详细地址:</span>
            <span class="spanborder">{{ ruleForm.address }}</span>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <span>电子邮箱:</span>
            <span class="spanborder">{{ ruleForm.email }}</span>
          </el-col>
          <el-col :span="12">
            <span>邮编:</span>
            <span class="spanborder">{{ ruleForm.post_code }}</span>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <span>客户类型:</span>
            <span class="spanborder">{{ ruleForm.typevalue }}</span>
          </el-col>
          <el-col :span="12">
            <span>客户来源:</span>
            <span class="spanborder">{{ ruleForm.source }}</span>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <span>录入时间:</span>
            <span class="spanborder">{{ ruleForm.date }}</span>
          </el-col>
          <el-col :span="12">
            <span>备注:</span>
            <span class="spanborder">{{ ruleForm.remark }}</span>
          </el-col>
        </el-row>

        <el-form-item class="btn">
          <el-button type="info" @click="resetForm('ruleForm')">关闭</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import { mapActions } from "vuex";
export default {
  name: "AddPool",
  data() {
    return {
      ruleForm: {
        customer_name: "",
        contact_name: "",
        phone: "",
        qq: "",
        address: "",
        remark: "",
        typevalue: "",
        source: "",
        email:'',
        post_code:'',
      },
      fileList: [],
      rules: {
        customer_name: [
          { required: true, message: "请输入", trigger: "blur" },
          { min: 2, max: 5, message: "长度在 2 到 5 个字符", trigger: "blur" },
        ],
        region: [
          { required: true, message: "请选择联系人", trigger: "change" },
        ],
        desc: [{ required: true, message: "请填写", trigger: "blur" }],
      },
    };
  },
  methods: {
    ...mapActions(["customerSeasStore/DicListActions"]),

    resetForm(formName) {
      //关闭
      this.$refs[formName].resetFields();
      this.$router.back();
    },
  },
  created() {
    // 获取数据
    const Info = this.$route.query.poollistMsg;
    console.log(Info);
    this.ruleForm.customer_name = Info.customer_name;
    this.ruleForm.contact_name = Info.contact_name;
    this.ruleForm.phone = Info.contact_phone;
    this.ruleForm.qq = Info.qq;
    this.ruleForm.address = Info.address;
    this.ruleForm.email = Info.email;
    this.ruleForm.post_code = Info.post_code;
    this.ruleForm.source = Info.origin.value;
    this.ruleForm.date = Info.import_Date;
    this.ruleForm.remark = Info.remark;
    this.ruleForm.typevalue = Info.type.value;
  },
};
</script>

<style lang="scss" scoped>
seasDetails {
  width: 100%;
  margin: 40px auto;
  padding: 50px;
  box-sizing: border-box;
  background-color: #eee;
}
.seasinfo span {
  font-size: 20px;
}
.el-col {
  margin-bottom: 20px;
}
.spanborder {
  display: inline-block;
  margin-left: 10px;
}
.btn {
  margin: 20px auto;
  box-sizing: border-box;
}
.innerbox {
  background-color: #fff;
  padding: 50px;
  box-sizing: border-box;
}
</style>